home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8377 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news1.h1.usa.pipeline.com!usenet
  2. From: grantp@usa.pipeline.com(Pete)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: VC++4.0 & SQL
  5. Date: 17 Feb 1996 12:08:07 GMT
  6. Organization: Kalevi, Inc.
  7. Message-ID: <4g4gf7$pgb@news1.usa.pipeline.com>
  8. NNTP-Posting-Host: pipe2.h1.usa.pipeline.com
  9. X-PipeUser: grantp
  10. X-PipeHub: usa.pipeline.com
  11. X-PipeGCOS: (Pete)
  12. X-Newsreader: Pipeline USA v3.3.0
  13.  
  14. On Feb 15, 1996 21:25:16 in article <VC++4.0 & SQL>, 'schlaep@ibm.net
  15. (Patrick Schlaepfer)' wrote: 
  16.  
  17.  
  18. >Source code of the SQL testprogram, copied 
  19. >from the MS Visual C++ CD. 
  20. >Error Message I get: 
  21. >--------------------Configuration: Text1 - Win32 
  22. >Debug-------------------- 
  23. >Compiling... 
  24. >Text1.cpp 
  25. >C:\home\patrick\msdv\simple_odbc\Text1.cpp(26) : error C2664: 
  26. >'SQLConnect' :  
  27. >cannot convert parameter 2 from 'char [8]' to 'unsigned char *' (new 
  28. >behavior; please see help) 
  29.  
  30. >retcode = SQLConnect(hdbc, "EmpData", SQL_NTS, 
  31. >"JohnS", SQL_NTS, 
  32. >"Sesame", SQL_NTS); 
  33. ODBC uses unsigned characters.  You gotta cast all your 
  34. 'ordinary' (signed) chars to unsigned: 
  35.  
  36.    SQLConnect(hdbc, (UCHAR FAR*)"EmpData", ..... 
  37.  
  38. The FAR business isn't really needed in WIN32, but that's 
  39. what the prototype has so to be safe, use it. 
  40.  
  41. -- 
  42. Pete Grant 
  43. Kalevi, Inc. 
  44. Software Engineering & development
  45.